local skel = fk.CreateSkill {
  name = "rmt__airong",
}

Fk:loadTranslationTable{
  ["rmt__airong"] = "哀荣",
  [":rmt__airong"] = "当你需使用【闪】时，你可以摸三张牌，然后若你手牌数为全场唯一最多，你与当前回合角色交换手牌，视为使用之。",

  ["#rmt__airong"] = "哀荣：你可以摸三张牌，若手牌数唯一最多，你与当前回合角色交换手牌并视为使用【闪】",

  ["$rmt__airong1"] = "嵇侍中、嵇侍中，丹血寄朕朕负卿……",
  ["$rmt__airong2"] = "新衣裾、新衣裾，甚暖、甚善！",
}

skel:addEffect(fk.AskForCardUse, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and (Exppattern:Parse(data.pattern):matchExp("jink"))
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local yes = false
    player:drawCards(3, skel.name)
    if not player.dead and not player:isKongcheng() and
      table.every(room:getOtherPlayers(player), function (p)
        return player:getHandcardNum() > p:getHandcardNum()
      end) then
      yes = true
      if not room.current.dead and room.current ~= player then
        room:swapAllCards(player, {player, room.current}, skel.name)
      end
    end
    local card = Fk:cloneCard("jink")
    card.skillName = skel.name
    if yes and not player:prohibitUse(card) then
      data.result = {
        from = player,
        card = card,
        tos = {},
      }
      return true
    end
    return false
  end,
})

return skel
